﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WebSearch.Models.SearchModel>" %>
<%@ Import Namespace="WebSearch.Helpers" %>

<div id="search-form">
<% using (Html.BeginForm())
    { %>

    <%:Html.TextBoxFor(m => m.FulltextQuery, new { size = 60, @class = "search" })%>
    <button type="submit" class="search">Vyhledat</button>

    <fieldset class="collapsible" id="advanced-options">
        <legend>Rozšířené možnosti</legend>

        <div>
            <div>
                <%:Html.LabelFor(m => m.QueryMode) %>
                <%:Html.DropDownListFor(m => m.QueryMode, new SelectListItem[] {
                    new SelectListItem { Text = "všechna slova", Value = QueryBuilder.Mode.AND.ToString() },
                    new SelectListItem { Text = "alespoň jedno slovo", Value = QueryBuilder.Mode.OR.ToString() }
                }) %>
            </div>

            <div>
                <label class="type-list">Vyhledat jen:</label>
                <div class="type-list">
                    <%:Html.CheckboxList(m => m.QueryTypes, typeof(Golem.Indexer.Data.FileType)) %>
                </div>
            </div>
        </div>
    </fieldset>

<% } %>
</div>